Jan Beulich [Mon, 18 Jun 2012 15:02:01 +0000 (17:02 +0200)]
x86-64: don't allow non-canonical addresses to be set for any callback
Rather than deferring the detection of these to the point where they
get actually used (the fix for XSA-7, 25480:
76eaf5966c05, causing a #GP
to be raised by IRET, which invokes the guest's [fragile] fail-safe
callback), don't even allow such to be set.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Boris Ostrovsky [Mon, 18 Jun 2012 14:08:43 +0000 (15:08 +0100)]
x86, cpufreq: Change powernow's CPB status immediately
When command to modify turbo mode (CPB on AMD processors) comes
in the actual change happens later, when P-state transition is
requested. There is no time limit on when this transition will
occur and therefore change in CPB state may take long time from
the moment when command to toggle it is issued.
This patch makes CPB mode change happen immediately when request
is made.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
Dario Faggioli [Thu, 14 Jun 2012 15:05:42 +0000 (16:05 +0100)]
libxl: propagate down the error from libxl_domain_sched_params_set
So that the caller (e.g., libxl__build_post() ) knows and can deal with it.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Christoph Egger [Wed, 13 Jun 2012 09:51:26 +0000 (11:51 +0200)]
SVM: fix performance decrease with asid assignment
Do not clear asid cleanbit unconditionally. This shaves off 100 cycles
from the VMRUN instruction.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Jan Beulich [Tue, 12 Jun 2012 10:33:42 +0000 (11:33 +0100)]
x86-64: detect processors subject to AMD erratum #121 and refuse to boot
Processors with this erratum are subject to a DoS attack by unprivileged
guest users.
This is XSA-9 / CVE-2012-2934.
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Tue, 12 Jun 2012 10:33:40 +0000 (11:33 +0100)]
x86_64: Do not execute sysret with a non-canonical return address
Check for non-canonical guest RIP before attempting to execute sysret.
If sysret is executed with a non-canonical value in RCX, Intel CPUs
take the fault in ring0, but we will necessarily already have switched
to the the user's stack pointer.
This is a security vulnerability, XSA-7 / CVE-2012-0217.
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Signed-off-by: Ian Campbell <Ian.Campbell@citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Keir Fraser <keir.xen@gmail.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Mon, 11 Jun 2012 14:15:28 +0000 (15:15 +0100)]
x86: get rid of BOOT_TRAMPOLINE
We recently saw a machine that has the EBDA extending as low as
0x7c000, so that Xen fails to boot after relocating the trampoline.
To fix this, I removed BOOT_TRAMPOLINE and bootsym_phys completely.
Here are the parts:
1) the trampoline segment is set to 64k below the EBDA. head.S grows
the ability to relocate the trampoline segment
2) reloc.c is made position-independent. It allocates data below the
trampoline, whose address is passed in _eax.
3) cmdline.S is called before relocating, so all bootsym_phys there
become sym_phys.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
jb: - fall back to low memory size (instead of segment 0x7c00) if EBDA
value is out of range
- also add upper limit check on EBDA value
- fix and simplify inline assembly operands in reloc_mbi_struct()
- use lret instead of retf
- renamed early_stack to wakeup_stack, defined and used now only
in wakeup.S
- aligned reloc.bin's end of .text to 16 bytes, so that checking
__bss_start == end works reliably
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
Andrew Cooper [Mon, 11 Jun 2012 14:12:50 +0000 (15:12 +0100)]
x86/nmi: Fix deadlock in unknown_nmi_error()
Additionally, correct the text description to reflect what is being
done, and make use of fatal_trap() in preference to kexec_crash() in
case an unknown NMI occurs before a kdump kernel has been loaded.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Mukesh Rathor [Mon, 11 Jun 2012 14:11:58 +0000 (15:11 +0100)]
gdbsx: send virq to guest if gdbsx_vcpu_event is not active
gdbsx got broken along the way. During domain pause, don't send
VIRQ_DEBUGGER to guest if gdbsx is active on that guest.
Signed-off-by: Mukesh Rathor <mukesh.rathor@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
Olaf Hering [Fri, 8 Jun 2012 16:00:13 +0000 (17:00 +0100)]
xl.cfg: document the cpuid= option
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Anthony PERARD [Fri, 8 Jun 2012 15:43:25 +0000 (16:43 +0100)]
tools/pygrub: Makefile cleanup
This patch removes the extra command `install pygrub` because this is already
done by the setup.py script.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Anthony PERARD [Fri, 8 Jun 2012 15:42:50 +0000 (16:42 +0100)]
tools/pygrub: Fix pygrub install
The script pygrub is currently installed in the wrong location. Instead of
/usr/lib/xen/bin, the script is installed in $destdir/usr/lib/xen/bin.
$(DESTDIR) is apply twice.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
diff -r
474b5a6b1d91 -r
836e6618e86b tools/pygrub/Makefile
--- a/tools/pygrub/Makefile Fri Jun 08 16:39:24 2012 +0100
+++ b/tools/pygrub/Makefile Fri Jun 08 16:42:05 2012 +0100
@@ -12,7 +12,7 @@ build:
install: all
CC="$(CC)" CFLAGS="$(CFLAGS)" $(PYTHON) setup.py install \
$(PYTHON_PREFIX_ARG) --root="$(DESTDIR)" \
- --install-scripts=$(DESTDIR)/$(PRIVATE_BINDIR) --force
+ --install-scripts=$(PRIVATE_BINDIR) --force
$(INSTALL_PYTHON_PROG) src/pygrub $(DESTDIR)/$(PRIVATE_BINDIR)/pygrub
$(INSTALL_DIR) $(DESTDIR)/var/run/xend/boot
ln -sf $(PRIVATE_BINDIR)/pygrub $(DESTDIR)/$(BINDIR)
Juergen Gross [Fri, 8 Jun 2012 15:39:24 +0000 (16:39 +0100)]
build: Correct typo introduced by c/s:25334
Signed-off-by: Juergen Gross <juergen.gross@ts.fujitsu.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Roger Pau Monne [Fri, 8 Jun 2012 15:22:22 +0000 (16:22 +0100)]
tools: disable libvchan build on NetBSD
NetBSD doesn't have a gntdev, so libvchan is unable to build due to
the lack of the header files gntalloc.h.
This is the error:
gcc -O1 -fno-omit-frame-pointer -m64 -g -fno-strict-aliasing
-std=gnu99 -Wall -Wstrict-prototypes -Wdeclaration-after-statement
-D__XEN_TOOLS__ -MMD -MF .init.o.d -fno-optimize-sibling-calls
-I../include -I.
-I/root/xen/xen-netbsd/tools/libvchan/../../tools/xenstore
-I/root/xen/xen-netbsd/tools/libvchan/../../tools/include
-I/root/xen/xen-netbsd/tools/libvchan/../../tools/libxc
-I/root/xen/xen-netbsd/tools/libvchan/../../tools/include -c -o init.o init.c
init.c:45:30: fatal error: xen/sys/gntalloc.h: No such file or directory
compilation terminated.
gmake[3]: *** [init.opic] Error 1
gmake[3]: *** Waiting for unfinished jobs....
init.c:45:30: fatal error: xen/sys/gntalloc.h: No such file or directory
compilation terminated.
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Christoph Egger <Christoph.Egger@amd.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Anthony PERARD [Fri, 8 Jun 2012 15:09:00 +0000 (16:09 +0100)]
libxl: Store VNC passwd in xenstore with QEMU upstream.
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Fri, 8 Jun 2012 15:05:38 +0000 (16:05 +0100)]
libxc: do not "panic" if a kernel is not a bzImage.
Up until the point where we think this is a bzImage there is no point in
printing panicy messages -- some other loader will have a go (probably the
compressed ELF one)
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Xuesen Guo [Fri, 8 Jun 2012 14:33:54 +0000 (15:33 +0100)]
tools: readnote: Add bzImage kernel support
Add the check of bzImage kernel and make it work
with RHEL 6 big zImage kernel
Signed-off-by: Xuesen Guo <Xuesen.Guo@hitachiconsulting.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Dario Faggioli [Fri, 8 Jun 2012 14:26:01 +0000 (15:26 +0100)]
xl: check for meaningful combination of sedf config file parameters
As it happens in the implementation of `xl sched-sedf -d ...', some
consistency checking is needed for the scheduling parameters when
they come from the config file.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 7 Jun 2012 18:46:57 +0000 (19:46 +0100)]
QEMU_TAG update
David Vrabel [Thu, 7 Jun 2012 18:41:27 +0000 (19:41 +0100)]
tools: do not install qemu if just doing a build
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Jackson [Thu, 7 Jun 2012 18:40:23 +0000 (19:40 +0100)]
QEMU_TAG update
Olaf Hering [Thu, 7 Jun 2012 17:51:42 +0000 (18:51 +0100)]
tools: pass EXTRA_CFLAGS via environment
Currently qemu-xen will be compiled with CFLAGS only if CFLAGS was
already in the environment during make invocation. If CFLAGS is in
environment then make will append all of the various flags specified in
xen Makefiles to this environment variable, which is then used in qemu
configure. Since qemu-xen is not ready for compiler flags like
"-std=gnu99" compilation will fail. If CFLAGS is not in environment,
then configure will use just its own "-O2 -g" because make does not
export its own CFLAGS variable.
>From a distro perspective, it is required to build libraries and
binaries with certain global cflags (arbitrary gcc options). Up to the
point when qemu-xen was imported it worked as expected by exporting
CFLAGS before 'make tools'. Now qemu-upstream reuses these CFLAGS, but
it cant deal with the result.
This patch extends the tools Makefiles so that three new environment
variables are recognized:
EXTRA_CFLAGS_XEN_TOOLS= specifies CFLAGS for the tools build.
EXTRA_CFLAGS_QEMU_TRADITIONAL= specifies CFLAGS for old qemu.
EXTRA_CFLAGS_QEMU_XEN= specifies CFLAGS for new qemu.
Special care needs to be taken in tools/firmware because the resulting
binaries are not linked with the hosts runtime libraries. These binaries
run in guest context. To avoid build errors from gcc options like
-fstack-protector, reuse existing practice to unset the new
EXTRA_CFLAGS_XEN_TOOLS for the firmware dirs.
The new feature can be used like this in a rpm xen.spec file:
export EXTRA_CFLAGS_XEN_TOOLS="${RPM_OPT_FLAGS}"
export EXTRA_CFLAGS_QEMU_TRADITIONAL="${RPM_OPT_FLAGS}"
export EXTRA_CFLAGS_QEMU_XEN="${RPM_OPT_FLAGS}"
./configure \
--libdir=%{_libdir} \
--prefix=/usr
make
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 7 Jun 2012 17:45:22 +0000 (18:45 +0100)]
xend: do not run a hotplug script from qemu on Linux
The current vif-hotplug-common.sh for renaming the tap device is failing
because it is racing with this script and therefore the device is unexpectedly
up when we come to rename it.
Fix this in the same way as libxl does, by disabling the script (only on
Linux).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Ian Campbell [Thu, 7 Jun 2012 17:34:25 +0000 (18:34 +0100)]
libxl: remove libxl__error_set prototype
The implementation went away in 25181:
26f72d923cb9 "libxl: Crash (more
sensibly) on malloc failure".
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Simon Rowe [Thu, 7 Jun 2012 17:23:00 +0000 (18:23 +0100)]
xenstore: set read_thread stacksize
xs_watch() creates a thread to wake watchers using default attributes. The
stacksize can be quite large (8 MB on Linux), applications that link against
xenstore end up having a larger memory footprint than necessary.
Signed-off-by: Simon Rowe <simon.rowe@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Simon Rowe [Thu, 7 Jun 2012 17:22:20 +0000 (18:22 +0100)]
xenstore: block signals in watch wakeup thread
The thread created to wakeup watchers is not intended to handle signals
(and a later patch will reduce it's stack size which makes it unsuitable
for doing so).
Signed-off-by: Simon Rowe <simon.rowe@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Jan Beulich [Wed, 6 Jun 2012 15:37:05 +0000 (16:37 +0100)]
xen: fix page_list_splice()
Other than in __list_splice(), the first element's prev pointer
doesn't need adjustment here - it already is PAGE_LIST_NULL. Rather
than fixing the assignment (to formally match __list_splice()), simply
assert that this assignment is really unnecessary.
Reported-by: Jisoo Yang <jisooy@gmail.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Also assert that the prev pointers are both PAGE_LIST_NULL.
Signed-off-by: Keir Fraser <keir@xen.org>
Committed-by: Keir Fraser <keir@xen.org>
Boris Ostrovsky [Wed, 6 Jun 2012 15:34:53 +0000 (16:34 +0100)]
xenpm, x86: Fix reporting of idle state average residency times
If CPU stays in the same idle state for the full duration of
xenpm sample then average residency may not be reported correctly
since usage counter will not be incremented.
In addition, in order to calculate averages correctly residence
time and usage counter should be read and written atomically.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
Dario Faggioli [Wed, 6 Jun 2012 15:33:21 +0000 (16:33 +0100)]
xen: enhance dump_numa output
By showing the number of free pages on each node.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Dario Faggioli [Wed, 6 Jun 2012 14:57:08 +0000 (15:57 +0100)]
libxl: introduce LIBXL_DOMAIN_TYPE_INVALID
To avoid recent gcc complaining about:
libxl.c: In function 'libxl_primary_console_exec':
libxl.c:1233:9: error: case value '
4294967295' not in enumerated type 'libxl_domain_type' [-Werror=switch]
Also:
- have all the call sites of libxl__domain_type() return with error in
case the function returns LIBXL_DOMAIN_TYPE_INVALID;
- adjust all other code segments where -Wswitch makes would claim that
LIBXL_DOMAIN_TYPE_INVALID is not handled by adding a "default: abort();"
clause.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- use LIBXL_DOMAIN_TYPE_INVALID instead of -1 for
libxl_domain_build_info.type's keyvar_init_val.
-- what used to be libxl_primary_console_exec is now in
libxl__primary_console_find so resolve the rejected hunk
accordingly ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Olaf Hering [Wed, 6 Jun 2012 12:53:59 +0000 (13:53 +0100)]
xl.cfg: document the maxmem= option
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Bamvor Jian Zhang [Wed, 6 Jun 2012 11:46:18 +0000 (12:46 +0100)]
libxl: Add API to retrieve domain console tty
This api retrieve domain console from xenstore. With this new api, it is easy
to implement "virsh console" command in libvirt libxl driver.
Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- use NOGC instead of 0 to allow improvements to this infrastructure
in the future ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Dario Faggioli [Wed, 6 Jun 2012 11:46:17 +0000 (12:46 +0100)]
libxl: convert malloc() to libxl__zalloc(NULL, ...)
And ditch the error handling in libxl_get_cpu_topology()
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
[ ijc -- define and use NOGC instead of NULL to allow improvements to this
infrastructure in the future ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Sat, 2 Jun 2012 07:39:45 +0000 (08:39 +0100)]
ocaml: fix build after 25446:
648508ee27a2, 25449:
68d46c5ea0a3 et al.
These renamed a type and the associated functions and the ocaml bindings were
not updated to suit.
This also highlighted that libxl_domain_sched_params should not be DIR_IN since
it is also use as an output struct.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Jackson [Fri, 1 Jun 2012 17:02:03 +0000 (18:02 +0100)]
libxl: fix Makefile race bug relating to _paths.h
_paths.h needs to be in AUTOINCS. That arranges for it to be an
explicit dependency of all object files. This is necessary so that it
is made before any compilation is attempted.
Making it a dependency of xl.h (as in 25426:
e53a1d3c212c) is harmless,
but not sufficient because that only takes effect if there is already
an autogenerated .d file naming xl.h as a dependency of relevant
object files.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Olaf Hering [Fri, 1 Jun 2012 11:06:22 +0000 (12:06 +0100)]
libxl: fix typos in libxl_cpuid_parse_config
Fix typo in comment.
Fix cpuid_flags array init, use correct number of arguments for empty
array entry.
Signed-off-by: Olaf Hering <olaf@aepfle.de>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 1 Jun 2012 11:06:21 +0000 (12:06 +0100)]
libxl: expose a single get/setter for domain scheduler parameters
This is consistent with having a single struct for all parameters.
Effectively renames and exports libxl__sched_set_params as
libxl_domain_sched_params_set. libxl_domain_sched_params_get is new.
Improve const correctness of the setters while I'm here.
Use shorter LOG macros when touching a line anyway.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 1 Jun 2012 11:06:20 +0000 (12:06 +0100)]
libxl: move libxl__sched_set_params into libxl.c
All the other sched functions are here and I'm just about to make those static
functions as I make libxl__sched_set_params the public function.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 1 Jun 2012 11:06:20 +0000 (12:06 +0100)]
libxl: make it possible to explicitly specify default sched params
To do so we define a discriminating value which is never a valid real value for
each parameter.
While there:
- removed libxl_sched_*_domain in favour of libxl_domain_sched_params.
- use this new functionality for the various xl commands which set sched
parameters, which saves an explicit read-modify-write in xl.
- removed call of xc_domain_getinfolist from a few functions which weren't
actually using the result (looks like a cut and paste error)
- fix xl which was setting period for a variety of different config keys.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 1 Jun 2012 11:06:19 +0000 (12:06 +0100)]
libxl: rename libxl_sched_params to libxl_domain_sched_params
Remove credit scheduler global options from the struct, they were never used
anyway.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Fri, 1 Jun 2012 11:06:18 +0000 (12:06 +0100)]
libxl: add internal function to get a domain's scheduler
This takes into account cpupools.
Add a helper to get the info for a single cpu pool, refactor libxl_list_cpupool
t use this. While there fix the leaks due to not disposing the partial list on
realloc failure in that function.
Fix the failure of sched_domain_output to free the poolinfo list.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:40 +0000 (10:20 +0100)]
arm: Enable VFP at boot
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:39 +0000 (10:20 +0100)]
arm: allow ourselves access to all coprocessors in non-secure mode
We'll need it to be able to use the VFP extensions, for example.
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:39 +0000 (10:20 +0100)]
arm: missing __init annotation
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:38 +0000 (10:20 +0100)]
arm: avoid memory write in switch to Hyp mode
Assemble the new CPSR in registers instead. It's slightly cleaner,
And makes it possible to have a read-only text section.
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:37 +0000 (10:20 +0100)]
arm: Move hyp-mode entry code out of line.
This code is grottier than the rest of the start-of-day code and
very specific to the software model we're developing on.
Segregate it accordingly, by putting it in its own file.
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Tim Deegan [Fri, 1 Jun 2012 09:20:36 +0000 (10:20 +0100)]
arm: More interrupt setup at start-of-day for secondary CPUs
Signed-off-by: Tim Deegan <tim@xen.org>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:35 +0000 (10:20 +0100)]
arm: implement event injection
Implement vcpu_mark_events_pending using the vgic to inject PPI 31, that
we reserve for Xen usage.
In the future the interrupt used for event injection might be dynamic
and could be written into the device tree.
Otherwise it could be an SGI choosen by the guest and passed to Xen
through an hypercall.
Considering that:
- it is easy to determine if an event notification
interrupt has already been EOI'd by the guest just looking at the
evtchn_upcall_pending bit in the shared_info page;
- we can safely assume that there is at most one event notification
interrupt pending at any time in any set of LR registers because we
never inject more than a single event notification interrupt in one vcpu
(see vcpu_mark_events_pending);
we can avoid requesting maintenance interrupts for
VGIC_IRQ_EVTCHN_CALLBACK, provided that we check for event notification
interrupts that need to be cleared in the following places:
- maintenance interrupt entry;
- gic_set_guest_irq;
that is every time we are about to write to an LR.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:35 +0000 (10:20 +0100)]
arm: remove VGIC_SOFTIRQ
Instead of using a softirq to check whether we need to set the VI bit in
the HCR (IRQ injection in the guest), always check the lr_mask on
leave_hypervisor_tail.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:34 +0000 (10:20 +0100)]
arm: implement flush_tlb_all_local and flush_tlb_local
Call flush_tlb_all_local from create_p2m_entries after removing a page
from the p2m.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:33 +0000 (10:20 +0100)]
arm: shared_info page allocation and mapping
Allocate the shared_info page at domain creation.
Implement arch_memory_op, only for XENMEM_add_to_physmap with space ==
XENMAPSPACE_shared_info, so that the guest can map the shared_info page.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:32 +0000 (10:20 +0100)]
arm: replace list_del and INIT_LIST_HEAD with list_del_init
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Fri, 1 Jun 2012 09:20:31 +0000 (10:20 +0100)]
arm: support fewer LR registers than virtual irqs
If the vgic needs to inject a virtual irq into the guest, but no free
LR registers are available, add the irq to a list and return.
Whenever an LR register becomes available we add the queued irq to it
and remove it from the list.
We use the gic lock to protect the list and the bitmask.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Jan Beulich [Thu, 31 May 2012 08:18:52 +0000 (10:18 +0200)]
passthrough: fix xsm-related oversight
Presumably a copy-and-paste mistake, which I also didn't notice while
unifying x86's and ia64's respective domctl implementations.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Jan Beulich [Thu, 31 May 2012 08:18:13 +0000 (10:18 +0200)]
x86/EDD: check MBR for BIOS magic before considering signature valid
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Andreas Herrmann [Thu, 31 May 2012 08:15:42 +0000 (10:15 +0200)]
x86/amd: re-enable CPU topology extensions in case BIOS has disabled it
BIOS will switch off the corresponding feature flag on family
15h models 10h-1fh non-desktop CPUs.
The topology extension CPUID leafs are required to detect which
cores belong to the same compute unit. (thread siblings mask is
set accordingly and also correct information about L1i and L2
cache sharing depends on this).
W/o this patch we wouldn't see which cores belong to the same
compute unit and also cache sharing information for L1i and L2
would be incorrect on such systems.
Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
Committed-by: Jan Beulich <jbeulich@suse.com>
Keir Fraser [Wed, 30 May 2012 12:25:51 +0000 (13:25 +0100)]
Rename: inslen -> insn_len
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Wed, 30 May 2012 12:23:31 +0000 (13:23 +0100)]
tools/tests/xen-access: INT3 trap type is s/w exception.
Signed-off-by: Keir Fraser <keir@xen.org>
Xudong Hao [Wed, 30 May 2012 10:38:41 +0000 (11:38 +0100)]
Add instruction length and trap type in HVMOP_inject_trap.
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Ian Campbell [Wed, 30 May 2012 09:57:10 +0000 (10:57 +0100)]
xl: xl.h depends on geenrated file _paths.h
Fixes build error.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Keir Fraser [Wed, 30 May 2012 08:40:44 +0000 (09:40 +0100)]
hvm: Add instruction length to hvm_trap info.
Add documentation notes to vmx_inject_trap() and respect instruiction
length parameter for software-generated exceptions/interrupts.
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Xiantao Zhang <xiantao.zhang@intel.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Keir Fraser [Wed, 30 May 2012 08:27:51 +0000 (09:27 +0100)]
xen: Define new struct hvm_trap and cleanup vmx exception
Define new struct hvm_trap to represent information of trap, and
renames hvm_inject_exception to hvm_inject_trap, then define a couple
of wrappers around that function for existing callers.
Signed-off-by: Keir Fraser <keir@xen.org>
Signed-off-by: Xudong Hao <xudong.hao@intel.com>
Committed-by: Keir Fraser <keir@xen.org>
Boris Ostrovsky [Wed, 30 May 2012 08:26:02 +0000 (09:26 +0100)]
xenpm: Fix reporting of C0 residence times
Idle state residence times as provided by pmstat_get_cx_stat() are not
reported precisely since remote core may be in idle state and
therefore has not updated its statistics at the time local core
collected them. This causes C0 residencies as calculated by xenpm to
sometimes become negative.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@amd.com>
Committed-by: Keir Fraser <keir@xen.org>
David Vrabel [Wed, 30 May 2012 08:25:11 +0000 (09:25 +0100)]
x86: document register for 6th hypercall argument
From: David Vrabel <david.vrabel@citrix.com>
Signed-off-by: David Vrabel <david.vrabel@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 30 May 2012 08:23:33 +0000 (09:23 +0100)]
gnttab: cleanup
- introduce local variables (shortcuts for frequently used
<dom>->grant_table)
- adjust first parameter of mapcount()
- drop lock acquisition from gnttab_get_version()
- remove hard tabs and adjust formatting
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Thomas <andrew.thomas@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 30 May 2012 08:22:51 +0000 (09:22 +0100)]
gnttab: mark maptrack free list tail with an explicit terminator
... instead of using the mutable current limit.
This also addresses an apparent off-by-one mistake when checking for
exhaustion of the maptrack table.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Thomas <andrew.thomas@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 30 May 2012 08:22:17 +0000 (09:22 +0100)]
gnttab: don't use domain lock for serialization
Instead use the affected domain's grant table lock, at once reducing
the scopes during which locks are being held and hence allowing
significantly better parallelism.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Tested-by: Andrew Thomas <andrew.thomas@oracle.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 30 May 2012 08:21:04 +0000 (09:21 +0100)]
x86: fix nested HVM initialization
- no need for calling nestedhvm_setup() explicitly (can be a normal
init-call, and can be __init)
- calling _xmalloc() for multi-page, page-aligned memory regions is
inefficient - use alloc_xenheap_pages() instead
- albeit an allocation error is unlikely here, add error handling
nevertheless (and have nestedhvm_vcpu_initialise() bail if an error
occurred during setup)
- nestedhvm_enabled() must no access d->arch.hvm_domain without first
checking that 'd' actually represents a HVM domain
Signed-off-by: Jan Beulich <JBeulich@suse.com>
Committed-by: Keir Fraser <keir@xen.org>
Stefano Stabellini [Wed, 30 May 2012 07:57:52 +0000 (08:57 +0100)]
libxl: make libxl__e820_alloc a static function
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:52 +0000 (08:57 +0100)]
libxl: move e820_names, e820_sanitize, libxl__e820_alloc to libxl_x86.c
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:51 +0000 (08:57 +0100)]
libxl: Introduce libxl__arch_domain_create (x86 version)
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:50 +0000 (08:57 +0100)]
libxl: Introduce libxl__arch_domain_create
Introduce an arch specific internal domain creation function.
The X86 version of libxl__arch_domain_create is going to be introduced
in the next few patches, to make it easier to spot all the code motions.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:49 +0000 (08:57 +0100)]
arm: compile libxl
libxl_cpuid_destroy has been renamed to libxl_cpuid_dispose; also cpuid
functions are only available on x86, so move them to libxl_cpuid.c.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:48 +0000 (08:57 +0100)]
arm: compile xentrace
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:48 +0000 (08:57 +0100)]
arm: compile memshr
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <Ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Wed, 30 May 2012 07:57:47 +0000 (08:57 +0100)]
arm: compile libxenguest
Introduce an empty implementation of the arch specific ARM functions in
xc_dom_arm.c.
Provide empty implementations of xc_domain_save and xc_domain_restore
when CONFIG_MIGRATE is not set.
Move xc_hvm_build.c to xc_hvm_build_x86.c because the implementation is
x86 specific, introduce xc_hvm_build_arm.c with empty stubs.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <Ian.Campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Tue, 29 May 2012 15:44:06 +0000 (16:44 +0100)]
libxl: remove lockdir and config dir from the API
These are only used by xl.
Rename _libxl_paths.h -> _paths.h, these are not actually "libxl" paths but
rather are part of the Xen build time configuration. It is fine for xl to also
consume them.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:53 +0000 (16:36 +0100)]
xl: destroy the disk on successful removal during block-detach
main_blockdetach needs to call libxl_device_disk_destroy so that all the
disk related entries are properly removed from xenstore.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:53 +0000 (16:36 +0100)]
libxl: add qdisk to libxl_string_to_backend
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:52 +0000 (16:36 +0100)]
libxl: wait for state "connected" in libxl__device_disk_local_attach
In order to make sure that the block device is available and ready to be
used, wait for state "connected" in the backend before returning.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- resolved simple conflict in libxl__device_disk_local_detach ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:51 +0000 (16:36 +0100)]
xl/libxl: implement QDISK libxl_device_disk_local_attach
- Spawn a QEMU instance at boot time to handle disk local attach
requests.
- Implement libxl__device_disk_local_attach for QDISKs in terms of a
regular disk attach with the frontend and backend running in the same
domain.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:50 +0000 (16:36 +0100)]
libxl: introduce libxl__alloc_vdev
Introduce libxl__alloc_vdev: find a spare virtual block device in the
domain passed as argument.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:49 +0000 (16:36 +0100)]
xl/libxl: add a blkdev_start parameter
Introduce a blkdev_start in xl.conf and a corresponding string in
libxl_domain_build_info.
Add a blkdev_start parameter to libxl__device_disk_local_attach: it is
going to be used in a following patch.
blkdev_start specifies the first block device to be used for temporary
block device allocations by the toolstack.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:48 +0000 (16:36 +0100)]
libxl: introduce libxl__device_disk_add
Introduce libxl__device_disk_add that takes an additional
xs_transaction_t paramter.
Implement libxl_device_disk_add using libxl__device_disk_add.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:48 +0000 (16:36 +0100)]
libxl: export libxl__device_from_disk
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:47 +0000 (16:36 +0100)]
libxl: add a transaction parameter to libxl__device_generic_add
Add a xs_transaction_t parameter to libxl__device_generic_add, if it is
XBT_NULL, allocate a proper one.
Update all the callers.
This patch contains a large number of unchecked xenstore operations, we
might want to fix this in the future.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:46 +0000 (16:36 +0100)]
libxl: libxl__device_disk_local_attach return a new libxl_device_disk
Introduce a new libxl_device_disk* parameter to
libxl__device_disk_local_attach, the parameter is allocated by the
caller. libxl__device_disk_local_attach is going to fill the new disk
with informations about the new locally attached disk. The new
libxl_device_disk should be passed to libxl__device_disk_local_detach
afterwards.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Stefano Stabellini [Tue, 29 May 2012 15:36:45 +0000 (16:36 +0100)]
libxl: make libxl_device_disk_local_attach/detach internal functions
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Dario Faggioli [Tue, 29 May 2012 10:36:36 +0000 (11:36 +0100)]
libxl: introduce libxl_vcpuinfo_list_free
And fix a leak due to it being missing.
Signed-off-by: Dario Faggioli <dario.faggioli@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Christoph Egger [Tue, 29 May 2012 10:12:45 +0000 (11:12 +0100)]
xenstore: fix crash on platforms with no gntdev driver implementation.
Fix pointer checks introduced in changeset 24757:
aae516b78fce.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Tue, 29 May 2012 09:31:39 +0000 (10:31 +0100)]
xl: remove all local "ctx" variables
xl has a global "ctx" variable, so there should be no need to pass a
ctx to any function.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- dropped xl_fork hunks on commit, this aspect was already done in
xl: track child processes for the benefit of libxl ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Campbell [Tue, 29 May 2012 09:31:38 +0000 (10:31 +0100)]
libxl: do not overwrite user supplied config when running bootloader
Currently when running the bootloader libxl will update b_info->u.pv.kernel,
.ramdisk, .cmdline and .bootloader. This can expose internal details, such
as temporary paths in /var/run/xen/bootloader.*/ to the user. This is
problematic because it means that the user cannot re-use the struct as is.
This does not effect xl in Xen 4.2+ since it always reparses the guest config
and reinitialises the build info, however it did cause issues with reboot in
4.1 (reported by Dmitry Morozhnikov) and may cause issues for other users of
libxl.
Instead make the libxl bootloader infrastructure provide output to its caller
which is slurped into the internal libxl__domain_build_state datastructure. If
no bootloader is configured then the bootloader instead propagates the user
supplied b_info config.
In order to simplify this push the error handling for the case where there is
no bootdisk down into libxl__bootloader_run. In principal there is no reason
why it shouldn't be possible to do a pure netboot guest with a suitable
bootloader, but I don't fix that here.
This change allow us to make the libxl_file_reference an internal API, and
eventually we might be able to get rid of it.
Also removes the publix libxl_run_bootloader interface, neither xl nor libvirt
use it.
I am proposing this for 4.2 due to the API change.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
[ ijc -- reduced log message in libxl__build_pv from INFO to DEBUG ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Ian Jackson [Tue, 29 May 2012 09:31:37 +0000 (10:31 +0100)]
xl: track child processes for the benefit of libxl
Each time xl forks, it needs to record the pid, so that its exit
status can be preserved if it happens that libxl's event loop reaped
it. Consequently we also have a new wrapper for waitpid, which in
that case returns the previously-reaped status.
When we get a console ready callback from libxl, check to see if we
have spawned but not reaped a previous console client, and if so reap
it now. (This is necessary to prevent improper use of the xlchild
struct, but has the happy consequence of checking the exit status of
the first console client in the pygrub case.)
Refactor the two calls to libxl_ctx_alloc into a new function
xl_ctx_alloc which also sets the child reaped handler callback.
All of this has the effect of suppressing a message
unknown child [nnnn] unexpected exited status zero
which would sometimes (depending on a race) appear with `xl create -c'
and pygrub.
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Reported-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Cc: Roger Pau Monne <roger.pau@citrix.com>
[ ijc -- corrected return codes in xl_reaped_callback to match documented
convention. ]
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Shriram Rajagopalan [Tue, 29 May 2012 09:31:37 +0000 (10:31 +0100)]
xl: Remus - fix docs
Explicitly mention that the current state of Remus support in xl
is experimental, with no disk/network buffering support.
Signed-off-by: Shriram Rajagopalan <rshriram@cs.ubc.ca>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
George Dunlap [Tue, 29 May 2012 09:31:36 +0000 (10:31 +0100)]
libxl: When checking BDF of existing slots, function should be decimal, not hex
Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Spotted-by: Konrad Wilk <konrad.wilk@oracle.com>
Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Andrew Cooper [Fri, 25 May 2012 07:21:25 +0000 (08:21 +0100)]
x86_64: Record entry vector for double faults.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Stefano Stabellini [Fri, 25 May 2012 07:20:14 +0000 (08:20 +0100)]
xen: domain_pirq_to_emuirq return IRQ_UNBOUND by default
domain_pirq_to_emuirq should return IRQ_UNBOUND rather than 0 on
missing entries. Add a default parameter to pirq_field, so that
callers can set any default return value they want; use IRQ_UNBOUND in
domain_pirq_to_emuirq.
This patch fixes a regression introduced by 23573: save/restore
failing on upstream QEMU with PV on HVM guests.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Keir Fraser <keir@xen.org>
Jan Beulich [Wed, 23 May 2012 15:20:18 +0000 (17:20 +0200)]
amd iommu: improve parse_event_log_entry()
- message table should be static (no need to set it up each time the
function gets executed)
- don't bail on out-of-range event code values
- use message table also to print the kind of otherwise unhandled
event codes
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Wei Wang <wei.wang2@amd.com>
Wei Wang [Wed, 23 May 2012 15:18:06 +0000 (17:18 +0200)]
amd iommu: Add workaround for erratum 732 & 733
Signed-off-by: Wei Wang <wei.wang2@amd.com>
Add missing barriers. Fix early return from parse_ppr_log_entry().
Slightly adjust comments. Strip trailing blanks.
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Committed-by: Jan Beulich <jbeulich@suse.com>
Roger Pau Monne [Wed, 23 May 2012 10:06:49 +0000 (11:06 +0100)]
libxl: reorder libxl_device unplug functions
This is a reorder of functions, no functional change. This is needed
because in future patches much code is added to libxl_device and it
needs to follow the usual ao operation scheme (prototypes, functions
and callbacks in order they should be called)
Signed-off-by: Roger Pau Monne <roger.pau@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>